package com.wwwc.index.servlet;

import java.io.*;
import java.awt.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.ServletRequestWrapper;
import java.net.*;

import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;

import com.wwwc.util.web.*;
import com.wwwc.index.ejb.EJBManager;
import com.wwwc.index.ejb.forum.*;

public class ForumUtils {

    public static boolean isUserAdmin (String admins, UserProfile up) {
	if(up == null) {
	    return false;
	}

	if (admins == null || admins.length()==0) {
	    return false;
	}

	admins = admins.toUpperCase();

	String user = (up.getUserName()).toUpperCase();
	if(admins.indexOf(user) == -1) {
	    return false;
	}
	return true;
    }

    public static boolean isUserManager (String managers, UserProfile up) {
	if(up == null) return false;
	if (managers == null || managers.length()==0) return false;
	String user = up.getUserName();
	user = user.toUpperCase();
	managers = managers.toUpperCase();
	if(managers.indexOf(user) == -1) {
	    return false;
	}
	return true;
    }
}






